from building import *

cwd = GetCurrentDir()
src = Glob('*.c')
CPPPATH = []

if GetDepend('SUPPORT_BUS_CRT'):
    CPPPATH.append(cwd + '/BusCRT')
    src += Glob('BusCRT/BusCRT.c') 

if GetDepend('SUPPORT_ENCODER_GUTR'):
    CPPPATH.append(cwd + '/EncoderGutr')
    src += Glob('EncoderGutr/EncoderGutr.c') 

if GetDepend('SUPPORT_GUTR_IDENT'):
    CPPPATH.append(cwd + '/GutrIdent')
    src += Glob('GutrIdent/GutrIdent.c') 
    
if GetDepend('SUPPORT_LINKAGE_LOG'):
    CPPPATH.append(cwd + '/LinkageLog')
    if GetDepend('SUPPORT_LINKAGE_LOG_MNG'):    
       src += Glob('LinkageLog/LinkageLogMng.c') 
       if GetDepend('SUPPORT_LINKAGE_LOG_MNG_ABE'):    
          src += Glob('LinkageLog/LinkageLogMng_cbAllBufEeprom.c') 
    if GetDepend('SUPPORT_LINKAGE_LOG_TO_EXP'):    
       src += Glob('LinkageLog/LinkageLogParser_ToExp.c')
       if GetDepend('SUPPORT_LINKAGE_LOG_TO_EXP_CB'):    
          src += Glob('LinkageLog/LinkageLogParser_ToExpCb.c')
    if GetDepend('SUPPORT_LINKAGE_LOG_TO_STR'):    
       src += Glob('LinkageLog/LinkageLogParser_ToStr.c')
       if GetDepend('SUPPORT_LINKAGE_LOG_TO_STR_CB'):    
          src += Glob('LinkageLog/LinkageLogParser_ToStrCb.c')
    if GetDepend('SUPPORT_LINKAGE_LOG_STATE_STR'):    
       src += Glob('LinkageLog/LinkageLogStateStr.c')

if GetDepend('SUPPORT_REC_JB'):
    CPPPATH.append(cwd + '/RecJB')
    src += Glob('RecJB/Rec.c') 
    if GetDepend('SUPPORT_REC_JB_ASSORT'):    
       src += Glob('RecJB/RecJb_Assort.c')
    elif GetDepend('SUPPORT_REC_JB_SAME'):    
       src += Glob('RecJB/RecJb_Same.c')   

LOCAL_CCFLAGS = ''
# LOCAL_CCFLAGS += ' -O0'

group = DefineGroup('GasIndustry', src, depend=[''], CPPPATH=CPPPATH, LOCAL_CCFLAGS=LOCAL_CCFLAGS)

Return('group')
